package com.ita.compeople.impl;

import java.rmi.RemoteException;

import com.ita.command.Command;
import com.ita.dao.DepartmentDao;
import com.ita.dao.PeopleDao;
import com.ita.po.People;
import com.ita.po.ReturnValue;

public class CmdOnePeople implements Command {
	
	private PeopleDao peopleDao;
	private Integer id;

	
	public CmdOnePeople(PeopleDao peopleDao,Integer id) {
		super();
		this.peopleDao = peopleDao;
		this.id = id;
	}


	@Override
	public ReturnValue execute() throws RemoteException {
		People people = peopleDao.loadPeople(id);
		ReturnValue returnValue = new ReturnValue();
		returnValue.setPeople(people);
		return returnValue;
	}

}
